<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('发帖')"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="form-group">
            <label class="col-sm-3 control-label ">主题：</label>
            <div class="col-sm-8">
                <input class="form-control" id="talkCenter" name="talkCenter" required type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">内容：</label>
            <div class="col-sm-8">
					<textarea class="form-control" id="talkContent" name="talkContent" required
                              style="margin: 0px 12px 0px 0px; width: 461px; height: 344px;" type="text"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    $(function () {

    });


    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
        if ($.validate.form()) {
            var talkCenter = $("input[name='talkCenter']").val();
            var talkContent = $("textarea[name='talkContent']").val();
            $.ajax({
                cache: true,
                type: "POST",
                url: ctx + "sau/mytalk/addMyTalk",
                data: {
                    "talkCenter": talkCenter,
                    "talkContent": talkContent
                },
                async: false,
                error: function (request) {
                    $.modal.alertError("系统错误");
                },
                success: function (data) {
                    $.operate.successCallback(data);
                }
            });
        }
    }

</script>
</body>
</html>
